package com.springapp.utils;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class UrlUtil {
	
	public String getURL() throws Exception {

		Properties parame = new Properties();
		String classpath=System.getProperty("user.dir");
		
		String urlpath=classpath+File.separator+"agent";
        InputStream in = new BufferedInputStream (new FileInputStream(urlpath+File.separator+"emcG.properties"));
        parame.load(in);
        String out = parame.getProperty ("out").trim();//输出路径 
        out=classpath+File.separator+out;
		return out;
	}
	
	public static String getPath(){
		String classpath=System.getProperty("user.dir")+File.separator;
		return classpath;
	}
	
	public static void main(String[] args) {
		UrlUtil uu=new UrlUtil();
		try {
			String str=uu.getURL();
			System.out.println(str);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
